{if $admin_request eq 'custom_forms'}
<div id="browse-records">
    <div id="tabs">
        <ul>
            <li>
                <a href="#tabs-new">{$lang.$base_request.t_addnew}</a>
            </li>
            <li>
                <a href="#tabs-existing">{$lang.$base_request.t_view}</a>
            </li>
            <li>
                <a href="#tabs-submitted">{$lang.$base_request.t_submitted}</a>
            </li>
        </ul>
        <div id="tabs-submitted">
            submitted data will be here
        </div>
        <div id="tabs-new">
            <div id="new-data"  class="ui-form">
                {include file="_admin/inc/inc_forms.tpl" fprefix="new"}
            </div><!-- //new-data -->
        </div><!-- //tabs-new -->
        <div id="tabs-existing">
            <table id="table-{$admin_request}" class="display datatable">
                <thead>
                    <tr>
                        {foreach $pv.settings.listing as $item} <th> {$lang.$base_request.$item} </th>
                        {/foreach} <th> {$lang.actions} </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td colspan="3" class="dataTables_empty">Loading data from server</td>
                    </tr>
                </tbody>
            </table>
        </div><!-- //tabs-existing -->
    </div><!-- //tabs -->
</div><!-- //browse-records -->
<div id="edit-record" class="ui-helper-hidden"></div><!-- //edit-record -->

{capture "$admin_request"}

{*
<script type="text/javascript" charset="utf-8">
        *}

    _sid ='{$user.session_id}';

    $('#wr-rightcontent #new-f_fields-holder .ff_accordion').accordion({
    autoHeight : false
    });

    $('#wr-rightcontent #new-f_fields-holder').dialog({
    autoOpen : false
    });

    $('#wr-rightcontent').on('click', '.holder-trigger', function(e) {

    var _key = $(this).data('key');
    var _fprefix = $(this).data('fprefix');

    $('#'+_fprefix+'-'+_key+'-holder').dialog('open');
    e.preventDefault();
    });

    {literal}

    $('#newdataform').on('click', '.form-trigger', function(e) {
    $('#new-f_fields').val($('#new-f_fields-listing').sortable('toArray').toString().replace(/f-/ig, ""));
    });

    $('#edit-record').on('click', '.form-trigger', function(e) {
    $('#save-f_fields').val($('#save-f_fields-listing').sortable('toArray').toString().replace(/f-/ig, ""));
    });

    $('#table-{/literal}{$admin_request}{literal}').dataTable( {
    "bJQueryUI": true,
    "sPaginationType": "full_numbers",

    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": _urlbegin + '/listing-{/literal}{$admin_request}/' + _urlend + _ajax,

    "aoColumns": [
    {$pv.settings.listing_js}{literal}
    { "mDataProp": "actions","bSortable": false  }
    ],
    "fnServerData": function ( sSource, aoData, fnCallback ) {
    $.ajax( {
    "global": false,
    "dataType": 'json',
    "type": "GET",
    "url": sSource,
    "data": aoData,
    "success": fnCallback
    });
    }
    } );

    {/literal}

    {*</script> *}

{/capture}

{/if} {* browse *}

{if $admin_request eq 'edit-custom_forms'}
<div id="save-data">
    {include file="_admin/inc/inc_forms.tpl" fprefix="save"}
</div>
<script type="text/javascript">
$(function(){ldelim}
{include file="_admin/inc/inc_js_edit.tpl"}
{literal}
if($('.field-holder').length > 1)
{
$('.field-holder:gt(1)').parent().remove();
$('.field-holder:gt(1)').remove();
}

$('#wr-rightcontent #save-f_fields-holder .ff_accordion').accordion({
autoHeight : false
});

$('#save-f_fields-holder').dialog({
autoOpen : false
});

if($('#save-f_fields').val() != '')
{
$.each($('#save-f_fields').val().split(','),function(i,v){
$('#holder-save-f_fields-'+v).find('a').trigger('click');
});
}

{/literal}
{rdelim});</script>
{/if} {* edit *}